Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sockets - Shubha #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Sockets - Shubha #28

wants to merge 3 commits into from

Conversation

shubha-rajan
Copy link

@shubha-rajan shubha-rajan commented Feb 8, 2019

Portmanteau Generator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What went well in your code style, such as indentation, spacing, variable names, readability, etc.? What was lacking? I think the indentation, spacing and variable names are all clear, but my code could probably use more comments.
How did creating the is_vowel? method affect your project? The 'is_vowel?' method allowed me to quickly write code to do other things that required vowel checking without having to repeat my code for checking vowels
What was your strategy for getting the correct set of letters from the first word into the portmanteau? I looped through the first word to find an end index by starting with an index equal to (word.length - 1) and incrementing backwards, breaking out of the loop once a vowel was identified. I then looped through the second word to find a start index, and then used the string.slice method to get the word parts, which I joined together to create my portmanteau.
What was your strategy for validating against inputs under 2 characters? I used an until loop which kept prompting the user to enter another input until the input length was greater than or equal to 2.
In the next project, what would you change about your process? What would you keep doing? I'm hoping to learn to use the debugger in VSCode and make use of that instead of running buggy/not working code and messing with it semi-blindly until it stops throwing errors.

Uses a different approach to get indexes for slicing
version includes optional enhancements
@shubha-rajan
Copy link
Author

Grade the one that's named generator.rb please! :) I uploaded the other files just so I could have them in my repo.

@dHelmgren
Copy link

Portmanteau Generator

What We're Looking For

Feature Feedback
Readable code with consistent indentation Looked good!
Practices using variables appropriately Yes!
Practices using conditionals appropriately Yes
Practices iteration appropriately Yes
Practices using custom methods appropriately Yes
Program validates against input under 2 characters Yes
Takes in two inputs and creates a portmanteau Yes!

Copy link

@dHelmgren dHelmgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! In the future, just turn in your most-complete version, as I use a tool to help me grade. I didn't know you had 3 files in here until I looked on github!

# test_consonant = "g"
# puts "Is #{test_consonant} a vowel?"
# puts is_vowel?(test_consonant)
# puts "in the run_generator method"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would delete this dead code! It just muddies the waters when someone goes to look through it.

# is_vowel checks to see if a specific character is a vowel
def is_vowel?(letter)
vowels = ["a", "e", "i", "o", "u"]
if vowels.include?(letter.downcase)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice trick!

end

# is_vowel checks to see if a specific character is a vowel
def is_vowel?(letter)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, personal style note, I'd move this function to the top of the code, because it gives context to what happens in your main program. Remember, your jobs are to 1) make it work good and 2) make it as easy to grok as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants